<#assign module="marketing"/>

<@override name="header">
<link rel="stylesheet" href="${ctx}/assets/css/bootstrap-multiselect.css">
<link rel="stylesheet" href="${ctx}/assets/css/datetimepicker.css">
</@override>
<@override name="body">

	<div class="row">
		<div class="col-md-12">
			<div class="panel panel-default">
				<div class="panel-heading">
					编辑活动信息	
					<label class="control-label"><font color="red">（带*表示必填项）</font></label>		   
				</div>
			    <div class="panel-body">
    				<form id="submit_form" action="${ctx}/activitymanage/update" class="form-horizontal" method="post">
    					<input type="hidden" id="id" name="id" value="${activityManage.id}"/>
		            	<input type="hidden" id="upload_img_logo_token" value="${upload_img_logo_token}" />
		               
		               	<@shiro.isMainCompany>
		               		<div class="form-group">
			                    <label class="col-sm-3 control-label"><em>*</em>所属公司：</label>
			                    <div class="col-sm-3">
			                    	<input type="hidden" id="companyNames" name="companyNames" value="" />
			                    	<select class="form-control" id="companyIds" name="companyIds" multiple="multiple" required>
			                    		<#if companys??>
			                    			<#list companys as company>
			                    				<option value="${company.id}" <#if activityManage.companyIds?contains(','+company.id+',')>selected="selected"</#if>>${company.abbreviation?if_exists}</option>
			                    			</#list>
			                    		</#if>
			                    	</select>
			                    </div>
			                </div>
		               	</@shiro.isMainCompany>
		               
		               <div class="form-group">
		                	<label class="col-sm-3 control-label">链接地址：</label>
		                	<div class="col-sm-3">
								<input class="form-control" type="text" id="chainedAddress" name="chainedAddress" value="<#if activityManage.chainedAddress??>${activityManage.chainedAddress}</#if>"/>
							</div>
		               </div>
		               
		                <div class="form-group">
		                    <label class="col-sm-3 control-label"><em>*</em>业务类型：</label>
		                    <div class="col-sm-3">
		                    	<select class="form-control" id="serviceType" name="serviceType" required>
		                    		<@daijia>
		                    		<option value="daijia" <#if activityManage.serviceType=='daijia'>selected="selected"</#if>>代驾</option>
		                    		</@daijia>
		                    		<@zhuan>
		                    		<option value="zhuanche" <#if activityManage.serviceType=='zhuanche'>selected="selected"</#if>>专车</option>
		                    		</@zhuan>
		                    		<@pao>
		                    		<option value="paotui" <#if activityManage.serviceType=='paotui'>selected="selected"</#if>>跑腿</option>
		                    		</@pao>
		                    		<@freight>
		                    		<option value="huoyun" <#if activityManage.serviceType=='huoyun'>selected="selected"</#if>>货运</option>
		                    		</@freight>
		                    		<@zhuanxian>
		                    		<option value="zhuanxian" <#if activityManage.serviceType=='zhuanxian'>selected="selected"</#if>>快车</option>
		                    		</@zhuanxian>
		                    	</select>
		                    </div>
		                </div>
				                
		                <div class="form-group">
		                	<label class="col-sm-3 control-label"><em>*</em>排序：</label>
		                	<div class="col-sm-3">
								<input class="form-control" type="number" id="sort" name="sort" value="${activityManage.sort}" />
							</div>
						</div>
											    
					    <div class="form-group">
		                    <label class="col-sm-3 control-label"><em>*</em>展示时间：</label>
		                    <div class="col-sm-3">
		                    	<input class="form-control" id="start" name="start" value="${activityManage.startDate?string('yyyy-MM-dd')}" type="text" disabled/>
		                    </div>
		                    <label style="float:left;" class="control-label">-</label>
		                    <div class="col-sm-3">
		                    	<input class="form-control" id="end" name="end" type="text" <#if activityManage.endDate??>value="${activityManage.endDate?string('yyyy-MM-dd')}"</#if> placeholder="不填写为不限制结束时间 " />
		                    </div>
		                </div>
		                <div class="form-group">
		                    <label class="col-sm-3 control-label"><em>*</em>展示位置：</label>
		                    <div class="col-sm-3" id="showLocation" >
		                    	<label>
			                    	<input type="checkbox" name="showLocation" value="activitycentre" <#if   activityManage.showLocation?contains("activitycentre")>checked="checked"</#if>/> <em>*</em>活动中心
		                    	</label>
		                    	<label>
			                    	<input type="checkbox" name="showLocation" value="business" <#if   activityManage.showLocation?contains("business")>checked="checked"</#if>/> 业务弹窗
		                    	</label>
		                    </div>
		                </div>    
				               <div class="form-group" id="activitycentre_div" <#if   !activityManage.showLocation?contains("activitycentre")>style="display:none;"</#if>>
			    					<label class="col-sm-3 control-label">活动中心图片：</label>
			    					<div class="col-sm-6" >
										<input type="hidden" name="centreActivityImage" <#if  activityManage.centreActivityImage??>value="${activityManage.centreActivityImage}"</#if> id="centreActivityImage"/>
										<div class="row">
											<div class="col-sm-3" >
											<button  type="button"  class="button button-pill button-flat-primary button-tiny" id="shareImage_btn">
												<i class="glyphicon glyphicon-open" ></i>添加图片</button>
											</div>
											<span class="help-block">建议图片大小550x320</span>
										</div>
										<div id="centre" style="margin-top:10px">
										</div>
										<#if  activityManage.centreActivityImage??><img class="img"  src="${ctx}${activityManage.centreActivityImage}" width="80" height="100" /></#if>
										<input style="display:none;" type="file" name="imgFile" id="activityImage"  accept=".bmp,.gif,.jpeg,.jpg,.png" />
									</div>
			    				</div>
			    			
			    				<div class="form-group" id="business_div" <#if   !activityManage.showLocation?contains("business")>style="display:none;"</#if>>
			    					<label class="col-sm-3 control-label">业务弹窗图片：</label>
			    					<div class="col-sm-6" >
										<input type="hidden" name="businessActivityImage" <#if  activityManage.businessActivityImage??>value="${activityManage.businessActivityImage}"</#if> id="businessActivityImage"/>
										<div class="row">
											<div class="col-sm-3" >
											<button  type="button"  class="button button-pill button-flat-primary button-tiny" id="shareImage_btn2">
												<i class="glyphicon glyphicon-open" ></i>添加图片</button>
											</div>
											<span class="help-block">建议图片大小550x765</span>
										</div>
										<div id="business" style="margin-top:10px">
										</div>
										<#if  activityManage.businessActivityImage??><img class="img2" id="imgBusinessActivityImage"  src="${ctx}${activityManage.businessActivityImage}" width="80" height="100" /></#if>
										<input style="display:none;" type="file" name="imgFile" id="activityImage2"  accept=".bmp,.gif,.jpeg,.jpg,.png" />
									</div>
			    				</div>
		                
		                
		                
		                
		                
		                <div class="form-group" style="margin-left:10px;">
		                	<label class="col-sm-3 control-label"></label>
			                <input id="submit_button" type="button" class="btn btn-primary" value="保存">
			                <input type="button" class="btn btn-default" onclick="window.location.href = '${ctx}/activitymanage/activitymanage';" value="返回">
			            </div>
			            
					</form>
        		</div>
			</div>
		</div>
	</div>

</@override>
<@override name="footer">
<script type="text/javascript">
	var main=false;
	<@shiro.isMainCompany>
		main=true;
	</@shiro.isMainCompany>
</script>
<script src="${ctx}/assets/js/bootstrap-multiselect.js"></script>
<script src="${ctx}/assets/js/bootstrap-datetimepicker.min.js"></script>
<script src="${ctx}/assets/js/bootstrap-datetimepicker.zh-CN.js"></script>
<script src="${ctx}/assets/js/ajaxfileupload.js"></script>
<script src="${ctx}/assets/js/activitymanage/editactivitymanage.js"></script>
</@override>
<@extends name="../layout.ftl"/>
